package com.example.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.user.model.po.UserPO;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserMapper extends BaseMapper<UserPO> {

    @Select("<script>" +
            " select a.role_code from u_role a left join u_user_role_rule b on a.id = b.role_id where b.user_id = #{userId} " +
            "</script>")
    List<String> getRoleCodeByUserId(Long userId);
}
